<?php
class Proveedores_model extends CI_Model {
    public function __construct() {
        $this->load->database();
    }
    
    public function get_proveedores() {
        $query = $this->db->query("SELECT * 
                                    FROM
                                        proveedores
                                    ORDER BY
                                        proveedor");
        return $query->result_array();
    }
    
    public function get_proveedor($idproveedor) {
        $query = $this->db->query("SELECT *
                                    FROM
                                        proveedores
                                    WHERE
                                        idproveedor = $idproveedor");
        return $query->row_array();
    }
    
    public function set_proveedor($datos) {
        $this->db->insert('proveedores', $datos);
    }
}
?>
